import * as API from './api';

import {
  currentList,
  currentPage,
  currentSave,
  currentUpdate,
  currentDelete,
  currentSelect,
  currentSelectList,

  currentPOST,
  currentGET,
  currentApi,

} from './modules';
import {
  GETNOBASE,
  GET,
} from './api';


export {
  GETNOBASE,
  GET,
};


export {
  currentApi,
  currentList,
  currentPage,
  currentSave,
  currentUpdate,
  currentDelete,
  currentSelect,
  currentSelectList,
  currentPOST,
  currentGET,
};

// 获取字典
export function getDicData(parameter) {
  var url = '/lanhai-system/system/core/sysDic/getByAlias?alias=' + parameter;
  return API.GET(url);
}

export function homeList(termId, cycleId) {
  const url = `/lanjian-das/internal/internalLeadershipCockpit/inspectionCoverage?termId=${termId}&cycleId=${cycleId}`;
  return API.POST(url);
}

export function getTeamPerson(teamId) {
  const url = `/lanjian-das/internal/internalLeadershipCockpit/getTeamPerson?teamId=${teamId}`;
  return API.POST(url);
}

export function organizationStatus(termId, cycleId) {
  const url = `/lanjian-das/internal/internalLeadershipCockpit/organizationStatus?termId=${termId}&cycleId=${cycleId}`;
  return API.POST(url);
}

export function internalLeadershipCockpit(cycleId) {
  const url = `/lanjian-das/internal/internalLeadershipCockpit/inspectionResults?cycleId=${cycleId}`;
  return API.POST(url);
}

export function rectificationSupervision(cycleId) {
  const url = `/lanjian-das/internal/internalLeadershipCockpit/rectificationSupervision?cycleId=${cycleId}`;
  return API.POST(url);
}

export function internalLeadershipCockpitQuery() {
  const url = `/lanjian-das/internal/internalLeadershipCockpit/query`;
  const params = {
    'pageNo': 1,
    'pageSize': 10,
    'sortField': 'serial_num_',
    'sortOrder': 'asc',
    'params': { 'Q_QXMC__S_LK': '' },
  };
  return API.POST(url,params);
}

export function rectificationSituation(cycleId) {
  const url = `/lanjian-das/internal/internalLeadershipCockpit/rectificationSituation?cycleId=${cycleId}`;
  return API.POST(url);
}

export function knowledgePrecipitation(treeId) {
  const url = `/lanjian-das/internal/internalLeadershipCockpit/knowledgePrecipitation?treeId=${treeId}`;
  return API.POST(url);
}

export function modelAccumulation() {
  const url = `/lanjian-das/internal/internalLeadershipCockpit/modelAccumulation`;
  return API.POST(url);
}

export function getHomeTermTargetList(params) {
  const url = `/lanjian-das/internal/internalLeadershipCockpit/getHomeTermTargetList`;
  return API.POST(url, {
    'pageNo': 1,
    'pageSize': 10000,
    'sortField': '',
    'sortOrder': 'asc',
    'params': params,
  });
}

export function dataResources() {
  const url = `/lanjian-das/internal/internalLeadershipCockpit/dataResources`;
  return API.POST(url);
}

export function getTermCycleTeamTree(param) {
  var url = `/lanjian-das/lanjian/inspect/inspectTeamPersonnel/getTermCycleTeamTree`;
  return API.POST(url, param);
}

export function getFirstLevelDirectory(param) {
  var url = `/lanjian-das/internal/internalLeadershipCockpit/getFirstLevelDirectory`;
  return API.POST(url, param);
}
